﻿--[[
   @brief    
   @author   rickonzhang
   @version  1.0
   @date     2015-08-25
--]]
right_corner_pop_wnd_control = {
    
}


function right_corner_pop_wnd_control.init()
    ierd_tgp.tpf_ui.Require("social\\right_corner_pop_wnd\\view.lua");
end

function right_corner_pop_wnd_control.on_mouse_hover_try_icon(event_id, json_str)
    if tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_SYSTEM_NOTIFY or 
       tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_TALK_MESSAGE then

        base_utility.log("[right_corner_pop_wnd_control]");
        local param_table = base_utility.json_to_table(json_str);
        right_corner_pop_wnd_view.show(true, param_table.x, param_table.y);
    end
end

function right_corner_pop_wnd_control.on_mouse_leave_try_icon(event_id, json_str)
    if tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_SYSTEM_NOTIFY or 
       tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_TALK_MESSAGE then

        base_utility.log("[right_corner_pop_wnd_control] on_mouse_leave_try_icon");
        right_corner_pop_wnd_view.show(false, 0, 0);
    end
end

function right_corner_pop_wnd_control.on_lbutton_click_try_icon(event_id, json_str)
    base_utility.log("[right_corner_pop_wnd_control]");
    --[[if tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_TALK_MESSAGE or 
      tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_SYSTEM_NOTIFY then
        right_corner_pop_wnd_view.hide_immediately();
        right_corner_pop_wnd_view.click_view_all(nil, nil);
    end]]
end

function right_corner_pop_wnd_control.on_hide_tray_tips(event_id, json_str)
    if tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_SYSTEM_NOTIFY or 
       tray_manager_model.current_tray_status == TRAY_STATUS.TRAY_TALK_MESSAGE then

        base_utility.log("[right_corner_pop_wnd_control] on_hide_tray_tips");
        right_corner_pop_wnd_view.hide_immediately();
    end
end

right_corner_pop_wnd_control.init();